JS Command Window

Description

Inserts a text area where you can enter Javascript commands to test. Useful for developers to help debug.

Discussion

The JS Command Window is a helpful control that adds an interactive JavaScript editor to your app. This control is designed to serve as a debugging aid during app development.

The JS Command Window is a Defined Control. You can insert it from the Defined Control section or using the Add Control button.

JS Command Window in Defined Controls
JS Command Window in Defined Controls

To use the JS Command Window, run your component. Enter the JavaScript you'd like to execute in the Javascript Command Window text area. Then, click Execute.

JS Command Window executing a simple script
JS Command Window executing a simple script

Your script can reference objects and elements in the application. It cannot, however, use JavaScript placeholders such as {dialog.object}. Placeholders are resolved by the Application Server prior to sending your component to the client's device. JavaScript run in the JS Command Window is executed on the client and is not preprocessed by the Application Server. To call functions or methods on the UX component, you need to use the resolved variable name for {dialog.object}.

You can determine the resolved placeholder value by either inspecting your app using the browser debugger or writing additional JavaScript to alert or display the resolved name. E.g., you could add a button with the following JavaScript to alert the resolved object name for {dialog.object}:

alert("{dialog.object}");